home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
-
- Splash Hack
-
- INIT and trap patch done at MacHack 1991. A simple animation replaces
- _SysBeep. The animation consists of a few PICTs loaded in the
- System Heap at startup. The patch code block is stuffed with references
- to the storage and installed. This file is the patch code.
-
- This is not an example of good practice in the Macintosh environment!
- Please consider this code - well you know - a HACK !!
-
- NOTICE: Distribution is restricted to non-commercial agencies, Internet
- (+other unix sites) and user groups, as long as this notice remains.
- Probably to people that know what they are doing also, but then again,
- who's to say ?!
-
-
- File Created 20Jun91 bh
-
- NOESIS Software Construction
- ***************************************************************************/
- #include <types.h>
- #include <QuickDraw.h>
-
- #define new_hdrs 0
-
- #if(new_hdrs)
- #include <Windows.h>
- #else
- #include <WindowMgr.h>
- #endif
-
-
- #define wT 5 /* basic animation delay */
-
- /*************************************************************************/
- pascal void main( short dur )
- {
- GrafPtr savP;
- WindowPtr win;
- Rect tR;
- long cnt;
- long savD3;
- long t;
- PicHandle resBase;
-
- asm {
- bra @c
- bas: dc.l 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0
- dc.l 0,0,0,0
- };
-
- c:
- SetRect( &tR, 60, 80, 416+60, 191+80 );
- #if(new_hdrs)
- win = NewWindow( (void*)0, &tR,
- (ConstStr255Param)"\p", true, 2,
- (WindowPtr)-1, false, 0 );
- #else
- win = NewWindow( (void*)0, &tR,
- "\p", true, 2,
- (WindowPtr)-1, false, 0 );
- #endif
- GetPort( &savP );
- SetPort( win );
- /* bkgnd Pic */
- asm {
- move.l @bas,resBase
-
- move.l resBase,-(SP) ; picHandle
- move.l resBase,A0
- move.l (A0),A0
- addq #2,A0
- move.l A0,-(SP) ; &picFrame
- _DrawPicture
- };
- Delay( wT, &t );
- /* Frames */
- asm {
- move.l d3,savD3
- move.l #13,D3
- loop: move.l D3,D1
- addq #1,D1
- move.l #14,D0
- sub D1,D0
- lsl #2,D0
- movea.l (PC,-194,D0),A0 ; code dependant offset, 68020 addr mode
- move.l A0,-(SP) ; picHandle[ cnt ]
- move.l (A0),A0
- addq #2,A0
- move.l A0,-(SP) ; &picFrame
- _DrawPicture
- };
- Delay( wT, &t );
- asm {
- dbf D3,@loop
- move.l savD3,D3
- };
-
- asm {
- move.l resBase,-(SP) ; bg picHandle
- move.l resBase,A0
- move.l (A0),A0
- addq #2,A0
- move.l A0,-(SP) ; &picFrame
- _DrawPicture
- };
-
- Delay( wT*3, &t );
- DisposeWindow( win );
- SetPort( savP );
- return;
- }
-
-
- /***************************** End of Listing *******************************/
-